#!/bin/bash

if [ "$EUID" -ne 0 ]; then
	echo "错误：此脚本必须以 root 用户身份运行" >&2
	exit 1
fi

# 检查是否已经设置了 FONT=default8x16
if ! grep -q '^FONT=default8x16' /etc/vconsole.conf; then
	# 注释掉所有现有的 FONT 设置
	sed -i '/^FONT=/ s/^/#/' /etc/vconsole.conf

	# 添加新的字体设置
	echo "FONT=default8x16" | tee -a /etc/vconsole.conf >/dev/null

	# 重启服务应用更改
	systemctl restart systemd-vconsole-setup.service
	echo "已更新控制台字体为 default8x16"
else
	echo "字体已设置为 default8x16，无需更改"
fi
# bash -c "$(curl -fsSl https://gitee.com/hevey88/install_script/raw/main/arch_change_console_font.sh)"
